<?php
class Lookup
{
	private static $_items=array();

	public static function items($type)
	{
		if(!isset(self::$_items[$type]))
			self::loadItems($type);
		return self::$_items[$type];
	}

	public static function item($type,$code)
	{
		if(!isset(self::$_items[$type]))
			self::loadItems($type);
		return isset(self::$_items[$type][$code]) ? self::$_items[$type][$code] : false;
	}

	private static function loadItems($type)
	{
		self::$_items[$type]=array();
		$models = array(			
			'gender'=>array(
				1=>'男',
				2=>'女',
			),			
			'categoryModel'=>array(
				GODHOUSE_CATEGORY_PRODUCT=>'产品模块',
				GODHOUSE_CATEGORY_NEWS=>'新闻模块',
				GODHOUSE_CATEGORY_GIFTS=>'积分模块',
				GODHOUSE_CATEGORY_BRAND=>'品牌模块'
			),
			'status'=>array(
				GODHOUSE_STATUS_DELLETED=>'已删除',
				GODHOUSE_STATUS_UNVERIFIED=>'待审核',
				GODHOUSE_STATUS_VERIFIED=>'已审核',
				GODHOUSE_STATUS_RUNNING=>'运行中',
				GODHOUSE_STATUS_PAUSED=>'已暂停',
				GODHOUSE_STATUS_MODIFIED=>'修改待审核',
				GODHOUSE_STATUS_REFUSED=>'审核退回',
				GODHOUSE_STATUS_COMPLETED=>'已完成',
				GODHOUSE_STATUS_LIMITED=>'达到限制',
				GODHOUSE_STATUS_NOSAVE=>'余额不足',
				GODHOUSE_STATUS_FAILED=>'失败',
				GODHOUSE_STATUS_INACTIVE=>'激活',
			),
			'orderStatus'=>array(
				GODHOUSE_STATUS_ORDER_PENDING=>'待处理',
				GODHOUSE_STATUS_ORDER_CONFIRMED=>'已确认',
				GODHOUSE_STATUS_ORDER_COMPLETE=>'已完成',
				GODHOUSE_STATUS_ORDER_CANCEL=>'取消',
				GODHOUSE_STATUS_ORDER_INVALID=>'无效',
				GODHOUSE_STATUS_ORDER_REFUSED=>'退货',
			),
			'payStatus'=>array(
				GODHOUSE_STATUS_PAY_UNPAID=>'未付款',
				GODHOUSE_STATUS_PAY_PAID=>'已付款',
				GODHOUSE_STATUS_PAY_PAYMENT=>'付款中',
				GODHOUSE_STATUS_PAY_FAIL=>'付款失败',
			),
			'deliveryStatus'=>array(
				GODHOUSE_STATUS_DELIVERY_PENDING=>'未发货',
				GODHOUSE_STATUS_DELIVERY_SHIPPED=>'已发货',
				GODHOUSE_STATUS_DELIVERY_PICKING=>'配货中',
				GODHOUSE_STATUS_DELIVERY_SHIPPING=>'发货中',
				GODHOUSE_STATUS_DELIVERY_RECEIVING=>'已收货',
			),
			'payType'=>array(
				GODHOUSE_PAY_TYPE_NETWORK=>'网上转帐',
				GODHOUSE_PAY_TYPE_BANK=>'银行汇款',
				GODHOUSE_PAY_TYPE_DELIVERY=>'货到付款',
			),
			'operationModule'=>array(
				GODHOUSE_OPERATION_MODULE_ORDER=>'订单',
			),
			'permission'=>array(
				'system'=>'系统管理',
				'order'=>'订单管理',
				'article'=>'文章管理',
				'user'=>'用户管理',
				'product'=>'产品管理',
				'category'=>'分类管理',
				'report'=>'报表管理',
				'area'=>'地区管理',
				'logistic'=>'配送管理',
				'group'=>'用户组管理',
				'gifts'=>'礼品管理',
				'swap'=>'兑换管理',
				'permission'=>'权限设置',
				'discount'=>'折扣设置',
			),
		);
		self::$_items[$type] = $models[$type];
	}
}